package cn.zzm.controller;

import cn.zzm.queue.ProducerQueue;
import cn.zzm.replyTo.ProducerR;
import cn.zzm.topic.ProducerTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: study
 * @description:
 * @author: 周昭名
 * @create: 2019-04-12 15:01
 **/
@RestController
public class MsgController {
    @Autowired
    ProducerQueue producerQueue;
    @Autowired
    ProducerTopic producerTopic;
    @Autowired
    ProducerR producerR;

    @RequestMapping("tSend")
    public String topicMsgSend(){
        producerTopic.sendMessage("springboot.topic","你好，我是springboot.topic的发送者");
        return "topic消息发送成功！";
    }

    @RequestMapping("qSend")
    public String queueMsgSend(){
        producerQueue.sendMessage("springboot.queue","你好，我是springboot.queue的发送者");
        return "queue消息发送成功！";
    }

    @RequestMapping("reply")
    public String replyMsgSend(){
        producerR.sendMessage("replyTestqueue","你好，我是replyTestqueue的发送者");
        return "queue消息发送成功！";
    }
}

